<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../print.css" type="text/css" media="print">
<meta content="EffectUtil,jp.raohmaru.effects.EffectUtil,getBitmapFilter,getColorMatrix,getEmptyColorMatrix,getFilterIndex,removeFilter,setFilter" name="keywords">
<title>jp.raohmaru.effects.EffectUtil</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'EffectUtil - Raohmaru AS3 Framework';
				var baseRef = '../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">Raohmaru AS3 

Framework</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../all-classes.html')" href="../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../all-classes.html')" href="../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../index-list.html')" href="../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../index.html?jp/raohmaru/effects/EffectUtil.html&amp;jp/raohmaru/effects/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;EffectUtil</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class EffectUtil"); titleBar_setSubNav(false,false,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">jp.raohmaru.effects</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class EffectUtil</td>
</tr>
</table>
<p></p>
 Conjunto de utilidades utilizadas por la clase jp.raohmaru.effects.ColorModifier.
 <p></p>
<p>
<span class="classHeaderTableLabel">See also</span>
</p>
<div class="seeAlso">
<a href="ColorModifier.html" target="">ColorModifier</a>
</div>
<br>
<hr>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getBitmapFilter()">getBitmapFilter</a>(target:DisplayObject, filterClass:Class):BitmapFilter</div>
<div class="summaryTableDescription">[static]
  Obtiene el primer objeto del tipo BitmapFilter dentro de la matriz <code>filters</code> del objeto DisplayObject que coincida con la clase especificada.</div>
</td><td class="summaryTableOwnerCol">EffectUtil</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getColorMatrix()">getColorMatrix</a>(target:DisplayObject):Array</div>
<div class="summaryTableDescription">[static]
  Obtiene la propiedad <code>matrix</code> del primer objeto ColorMatrixFilter que se halle dentro de la matriz <code>filters</code> del objeto DisplayObject.</div>
</td><td class="summaryTableOwnerCol">EffectUtil</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getEmptyColorMatrix()">getEmptyColorMatrix</a>():Array</div>
<div class="summaryTableDescription">[static]
  Obtiene una matriz de 20 valores, para utilizar con la propiedad <code>ColorMatrixFilter.matrix</code>.</div>
</td><td class="summaryTableOwnerCol">EffectUtil</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getFilterIndex()">getFilterIndex</a>(target:DisplayObject, filterClass:Class):int</div>
<div class="summaryTableDescription">[static]
  Obtiene el índice de una clase del paquete flash.filters dentro de la matriz <code>filters</code> del objeto DisplayObject.</div>
</td><td class="summaryTableOwnerCol">EffectUtil</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#removeFilter()">removeFilter</a>(target:DisplayObject, filterClass:Class):BitmapFilter</div>
<div class="summaryTableDescription">[static]
  Elimina un objeto BitmapFilter de la matriz <code>filters</code> del objeto DisplayObject que coincida con la clase especificada.</div>
</td><td class="summaryTableOwnerCol">EffectUtil</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#setFilter()">setFilter</a>(target:DisplayObject, filter:BitmapFilter):void</div>
<div class="summaryTableDescription">[static]
  Establece un objeto BitmapFilter en la matriz <code>filters</code> del objetivo especificado.</div>
</td><td class="summaryTableOwnerCol">EffectUtil</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="getBitmapFilter()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getBitmapFilter</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public static function getBitmapFilter(target:DisplayObject, filterClass:Class):BitmapFilter</code><p>
  Obtiene el primer objeto del tipo BitmapFilter dentro de la matriz <code>filters</code> del objeto DisplayObject que coincida con la clase especificada.
  Si no hay ninguna coincidencia, se obtendrá <code>null</code>
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">target</span>:DisplayObject</code> &mdash; Objeto de visualización del que obtener el objeto BitmapFilter
  </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">filterClass</span>:Class</code> &mdash; Objeto Class a buscar dentro de la matriz <code>DisplayObject.filters</code>
  </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>BitmapFilter</code> &mdash; Un objeto BitmapFilter o <code>null</code> en caso de no encontrar nada
  </td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">flash.filters.BitmapFilter</div>
</div>
<a name="getColorMatrix()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getColorMatrix</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function getColorMatrix(target:DisplayObject):Array</code><p>
  Obtiene la propiedad <code>matrix</code> del primer objeto ColorMatrixFilter que se halle dentro de la matriz <code>filters</code> del objeto DisplayObject.
  Si no no encuentra ningún objeto ColorMatrixFilter, se obtendrá una matriz con los 20 valores por defecto que componen la propiedad <code>ColorMatrixFilter.matrix</code>.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">target</span>:DisplayObject</code> &mdash; Objeto de visualización del que obtener la matriz
  </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Array</code> &mdash; Una referencia a <code>ColorMatrixFilter.matrix</code> o una nueva matriz
  </td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">flash.filters.ColorMatrixFilter.matrix<br>
<a href="../effects/EffectUtil.html#getEmptyColorMatrix()" target="">getEmptyColorMatrix()</a>
</div>
</div>
<a name="getEmptyColorMatrix()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getEmptyColorMatrix</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function getEmptyColorMatrix():Array</code><p>
  Obtiene una matriz de 20 valores, para utilizar con la propiedad <code>ColorMatrixFilter.matrix</code>. El conjunto de valores es el que por defecto tiene
  cualquier objeto ColorMatrixFilter: 
  <pre>
  1 0 0 0 0
  0 1 0 0 0
  0 0 1 0 0
  0 0 0 1 0
  </pre>
  </p><p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Array</code> &mdash; Una nueva matriz
  </td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">flash.filters.ColorMatrixFilter.matrix</div>
</div>
<a name="getFilterIndex()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getFilterIndex</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function getFilterIndex(target:DisplayObject, filterClass:Class):int</code><p>
  Obtiene el índice de una clase del paquete flash.filters dentro de la matriz <code>filters</code> del objeto DisplayObject. Si no no encuentra ningún
  objeto BitmapFilter cuya clase coincida, devuelve <code>-1</code>.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">target</span>:DisplayObject</code> &mdash; Objeto de visualización del que obtener el índice
  </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">filterClass</span>:Class</code> &mdash; Objeto Class a buscar dentro de la matriz <code>DisplayObject.filters</code>
  </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>int</code> &mdash; El índice del resultado
  </td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">flash.display.DisplayObject.filters</div>
<br>
<span class="label">Example</span>
<br> <div class='listing'><pre>
 import flash.display.Shape;
 import flash.filters.ColorMatrixFilter;
 import flash.filters.BlurFilter;
 import jp.raohmaru.effects.EffectUtil;
 
 var child:Shape = new Shape();
  child.graphics.beginFill(0xFFCC00);
  child.graphics.drawCircle(100, 100, 100);
  child.graphics.endFill();
 addChild(child);
 
 child.filters = [new ColorMatrixFilter()];
 
 trace( EffectUtil.getFilterIndex(child, ColorMatrixFilter) ); // 0
 trace( EffectUtil.getFilterIndex(child, BlurFilter) ); // -1</pre></div>
  <p></p>
</div>
<a name="removeFilter()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">removeFilter</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function removeFilter(target:DisplayObject, filterClass:Class):BitmapFilter</code><p>
  Elimina un objeto BitmapFilter de la matriz <code>filters</code> del objeto DisplayObject que coincida con la clase especificada.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">target</span>:DisplayObject</code> &mdash; Objeto de visualización del que eliminar un filtro
  </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">filterClass</span>:Class</code> &mdash; Objeto Class a buscar dentro de la matriz <code>DisplayObject.filters</code>
  </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>BitmapFilter</code> &mdash; Un objeto BitmapFilter o <code>null</code> en caso de fallar la eliminación
  </td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">flash.display.DisplayObject.filters</div>
</div>
<a name="setFilter()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">setFilter</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function setFilter(target:DisplayObject, filter:BitmapFilter):void</code><p>
  Establece un objeto BitmapFilter en la matriz <code>filters</code> del objetivo especificado. Si ya existe un objeto de la misma clase que
  <code>filter</code>, se reemplazará. En caso contrario, añadira el nuevo filtro al final de la matriz <code>filters</code>.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">target</span>:DisplayObject</code> &mdash; Objeto de visualización al que aplicar el filtro
  </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">filter</span>:BitmapFilter</code> &mdash; Objeto BitmapFilter a añadir
  </td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">flash.display.DisplayObject.filters</div>
<br>
<span class="label">Example</span>
<br> <div class='listing'><pre>
 import flash.display.Shape;
 import flash.filters.BlurFilter;
 import flash.filters.DropShadowFilter;
 import jp.raohmaru.effects.EffectUtil;
 
 var child:Shape = new Shape();
  child.graphics.beginFill(0xFFCC00);
  child.graphics.drawCircle(100, 100, 100);
  child.graphics.endFill();
 addChild(child);
 
 child.filters = [new BlurFilter()];
 EffectUtil.setFilter(child, new BlurFilter(20, 20));
 trace(child.filters.length); // 1
 
 EffectUtil.setFilter(child, new DropShadowFilter(15));
 trace(child.filters.length); // 2</pre></div>
  <p></p>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright">http://www.raohmaru.com</center>
</div>
</body>
</html>
<!--http://www.raohmaru.com-->
